""" 
    AF_ChangeTheme : 用于对Substance Painter的UI进行一些定制优化。
    作者：阿发你好@bilibili
    联系：https://space.bilibili.com/6708009
""" 
 
#from PySide2 import QtWidgets 
import substance_painter.ui 
 

 
def start_plugin(): 
    """This method is called when the plugin is started.""" 
    main_window = substance_painter.ui.get_main_window()
    print(f"Main window: {main_window}")
    
    # 备选颜色: #8A7B8A  / #645875 / #51333E
    main_window.setStyleSheet("""
            QToolButton {
                background-color: #00000000;
            }
            QToolButton:checked {
                background-color: #645875;
            }
            QToolButton:hover {
                background-color: #806005;
            }
            QToolButton:disabled {
                background-color: #aa333333;
            }             
        """)
    
def close_plugin(): 
    """This method is called when the plugin is stopped.""" 
    pass
 
if __name__ == "__main__": 
    start_plugin() 